#coding=utf-8

#批量上传pac文件到gae的脚本
import subprocess

def print_red(s):
  print '\033[0;31;48m%s\033[0m'%s 
  
email = 'zhengyiyi3000@gmail.com'
password = 'googleapp'

apps = ['jay-cdn', 'jay-cdn2', 'jay-cdn3']
command = 'appcfg.py --passin --no_cookies --application=%s --email=%s update /home/jay/xiaojaylib/jaycdn'

for a in apps:
    print_red(a)
    complete_command = command%(a, email)
    print complete_command, '\n'
    p = subprocess.Popen(complete_command, shell=True, stdin=subprocess.PIPE)
    p.communicate(password)
